# Reference: https://postmarketos.org/uipkg
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-ui-plasma-bigscreen
pkgver=1
pkgrel=2
_commit_configs="a8bd93e279c222be6058ef46b065c11e88aa8400"
pkgdesc="(Wayland) 10-feet variant of Plasma, made for big screen TVs"
url="https://wiki.postmarketos.org/wiki/Plasma_Bigscreen"
# Crashes on armhf due to https://gitlab.postmarketos.org/postmarketOS/pmaports/issues/75
# riscv64: plasma-workspace, qt5-qtbase need rebuild against libcui18n in alpine edge
arch="!armhf !riscv64"
license="GPL-3.0-or-later"
depends="
	plasma-bigscreen
	postmarketos-base-ui-plasma
	qt5-qtvirtualkeyboard
	"
_pmb_recommends="
	aura-browser
	breeze-icons5
	nymphcast
	plank-player
	"
subpackages="$pkgname-openrc"
source="$pkgname-$_commit_configs.tar.gz::https://invent.kde.org/plasma-bigscreen/bigscreen-image-settings/-/archive/$_commit_configs/bigscreen-image-settings-$_commit_configs.tar.gz
	qtlogging.ini
	nymphcast.desktop
	"
options="!check pmb:gpu-accel"

package() {
	install -Dm644 -t "$pkgdir"/etc/xdg/QtProject \
		"$srcdir"/qtlogging.ini
	install -Dm644 -t "$pkgdir"/etc/xdg/autostart \
		"$srcdir"/nymphcast.desktop

	install -dm755 "$pkgdir"/etc/skel
	mv "$srcdir"/bigscreen-image-settings-"$_commit_configs"/etc/xdg/* "$pkgdir"/etc/xdg
	mv "$srcdir"/bigscreen-image-settings-"$_commit_configs"/etc/skel/.config "$pkgdir"/etc/skel/
}

openrc() {
	install_if="$pkgname=$pkgver-r$pkgrel openrc"
	install="$subpkgname.post-install $subpkgname.post-upgrade"
	depends="
		elogind-openrc
		networkmanager-openrc
		tinydm-openrc
		"

	mkdir -p "$subpkgdir"
}

sha512sums="
a3b877e15f06078c4ac6017d2b6ce57902d23d40c0fbbc8e7ad0af8f5b9ddc802e8e353ee4f48a07315dd2d1fd1b34ed3bfc4235649ba27729cbfd67dad3675a  postmarketos-ui-plasma-bigscreen-a8bd93e279c222be6058ef46b065c11e88aa8400.tar.gz
341f0b866c315f37868ef3e7137cce8b53a0e8e6164e5af71b3e8e2fa68321afbf0652d76124ef84bade1393f701748852ac939aef9daff7e272a0df827780eb  qtlogging.ini
04b0dc1385072b5e9004068594c110678ed9efd6254fd98dee302524e0edf139f936de849d80253301552f9927409a8b0cf5ad32cdb9f7861ef0e72787610d3c  nymphcast.desktop
"
